
package mdoc.ejbsample;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Table;
import javax.persistence.NamedQuery;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;

@Entity
@NamedQuery(name = "findAllSalles", query = "select s from Salle s")
@Table(name="SALLES", schema = "test")
public class Salle implements java.io.Serializable {
	private static final long serialVersionUID = -3L;

	@Id @GeneratedValue(strategy = GenerationType.AUTO)
	private int id;
    private int capacite;

	@OneToOne @JoinColumn(name = "id")
	private SalleProg salleprog;

	public int getId() {
		return id;
	}

	public int getCapacite() {
		return capacite;
	}

	public void setCapacite(int Capacite) {
		this.capacite = Capacite;
	}

	@Override public String toString() {
		StringBuilder sb = new StringBuilder();
		sb.append("Salle[id=").append(getId()).append(", capacite=").append(getCapacite()).append("]");
		return sb.toString();
	}

	public void setSalleprog(SalleProg salleprog) {
		this.salleprog = salleprog;
	}

	public SalleProg getSalleprog() {
		return salleprog;
	}
}
